package com.zkt.auth.infra.basic.entity;

import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 赵开泰
 * @since 2025-03-22
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("auth_user")
public class AuthUser implements Serializable {
	
	@Serial
	private static final long serialVersionUID = 1L;
	
	/**
	 * 主键
	 */
	@TableId(value = "id")
	private Long id;
	
	/**
	 * 用户名/账号
	 */
	@TableField("user_name")
	private String userName;
	
	/**
	 * 用户昵称
	 */
	@TableField("nickname")
	private String nickname;
	
	/**
	 * 邮箱
	 */
	@TableField("email")
	private String email;
	
	/**
	 * 手机号
	 */
	@TableField("phone")
	private String phone;
	
	/**
	 * 密码
	 */
	@TableField("password")
	private String password;
	
	/**
	 * 性别
	 */
	@TableField("sex")
	private Integer sex;
	
	/**
	 * 头像
	 */
	@TableField("avatar")
	private String avatar;
	
	/**
	 * 状态 0启用 1禁用
	 */
	@TableField("status")
	private Integer status;
	
	/**
	 * 个人介绍
	 */
	@TableField("introduce")
	private String introduce;
	
	/**
	 * 特殊字段
	 */
	@TableField("ext_json")
	private String extJson;
	
	/**
	 * 创建人
	 */
	@TableField(value = "created_by",fill = FieldFill.INSERT)
	private String createdBy;
	
	/**
	 * 创建时间
	 */
	@TableField(value = "created_time",fill = FieldFill.INSERT)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime createdTime;
	
	/**
	 * 更新人
	 */
	@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
	private String updateBy;
	
	/**
	 * 更新时间
	 */
	@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime updateTime;
	
	/**
	 * 逻辑删除
	 */
	@TableField(value = "is_deleted", fill = FieldFill.INSERT)
	private Integer isDeleted;
	
}
